/*-
 * ByteBitValues.java
 *
 * $LastChangedBy: stein $
 * $LastChangedRevision: 37 $
 * $LastChangedDate: 2006-11-30 23:06:29 +0000 (Thu, 30 Nov 2006) $
 * $HeadURL: svn://localhost/SMS/src/com/googlecode/attention/sms/pdu/UDHI.java $
 *
 * Copyright (c) 2007, Stein Gunnar Bakkeby
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Stein Gunnar Bakkeby nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package com.googlecode.attention.util.bit;

/**
 * ByteBitValues - contains the value of each bit in a Java byte (8 bit).
 *
 * @author Stein Gunnar Bakkeby
 */
public final class ByteBitValues {
  /* Static field values */
  /** 11111111 */
  public static final int ALL = 0xFF;
  
  /* Single bit value */
  /** 00000001 */
  public static final int B0 = 1;
  /** 00000010 */
  public static final int B1 = 2;
  /** 00000100 */
  public static final int B2 = 4;
  /** 00001000 */
  public static final int B3 = 8;
  /** 00010000 */
  public static final int B4 = 16;
  /** 00100000 */
  public static final int B5 = 32;
  /** 01000000 */
  public static final int B6 = 64;
  /** 10000000 */
  public static final int B7 = 128;
  
  /* All bits except bit value */
  /** 11111110 */
  public static final int N0 = ALL ^ B0;
  /** 11111101 */
  public static final int N1 = ALL ^ B1;
  /** 11111011 */
  public static final int N2 = ALL ^ B2;
  /** 11110111 */
  public static final int N3 = ALL ^ B3;
  /** 11101111 */
  public static final int N4 = ALL ^ B4;
  /** 11011111 */
  public static final int N5 = ALL ^ B5;
  /** 10111111 */
  public static final int N6 = ALL ^ B6;
  /** 01111111 */
  public static final int N7 = ALL ^ B7;
  
  /* Range from n to m. */
  /** 00000011 */
  public static final int RANGE_0_TO_1 = B1 | B0;
  /** 00000111 */
  public static final int RANGE_0_TO_2 = B2 | B1 | B0;
  /** 00001111 */
  public static final int RANGE_0_TO_3 = B3 | B2 | B1 | B0;
  /** 00011111 */
  public static final int RANGE_0_TO_4 = B4 | B3 | B2 | B1 | B0;
  /** 00111111 */
  public static final int RANGE_0_TO_5 = B5 | B4 | B3 | B2 | B1 | B0;
  /** 01111111 */
  public static final int RANGE_0_TO_6 = B6 | B5 | B4 | B3 | B2 | B1 | B0;
  /** 11111111 */
  public static final int RANGE_0_TO_7 = B7 | B6 | B5 | B4 | B3 | B2 | B1 | B0;
  /** 00000110 */
  public static final int RANGE_1_TO_2 = B2 | B1;
  /** 00001110 */
  public static final int RANGE_1_TO_3 = B3 | B2 | B1;
  /** 00011110 */
  public static final int RANGE_1_TO_4 = B4 | B3 | B2 | B1;
  /** 00111110 */
  public static final int RANGE_1_TO_5 = B5 | B4 | B3 | B2 | B1;
  /** 01111110 */
  public static final int RANGE_1_TO_6 = B6 | B5 | B4 | B3 | B2 | B1;
  /** 11111110 */
  public static final int RANGE_1_TO_7 = B7 | B6 | B5 | B4 | B3 | B2 | B1;
  /** 00001100 */
  public static final int RANGE_2_TO_3 = B3 | B2;
  /** 00011100 */
  public static final int RANGE_2_TO_4 = B4 | B3 | B2;
  /** 00111100 */
  public static final int RANGE_2_TO_5 = B5 | B4 | B3 | B2;
  /** 01111100 */
  public static final int RANGE_2_TO_6 = B6 | B5 | B4 | B3 | B2;
  /** 11111100 */
  public static final int RANGE_2_TO_7 = B7 | B6 | B5 | B4 | B3 | B2;
  /** 00011000 */
  public static final int RANGE_3_TO_4 = B4 | B3;
  /** 00111000 */
  public static final int RANGE_3_TO_5 = B5 | B4 | B3;
  /** 01111000 */
  public static final int RANGE_3_TO_6 = B6 | B5 | B4 | B3;
  /** 11111000 */
  public static final int RANGE_3_TO_7 = B7 | B6 | B5 | B4 | B3;
  /** 00110000 */
  public static final int RANGE_4_TO_5 = B5 | B4;
  /** 01110000 */
  public static final int RANGE_4_TO_6 = B6 | B5 | B4;
  /** 11110000 */
  public static final int RANGE_4_TO_7 = B7 | B6 | B5 | B4;
  /** 01100000 */
  public static final int RANGE_5_TO_6 = B6 | B5;
  /** 11100000 */
  public static final int RANGE_5_TO_7 = B7 | B6 | B5;
  /** 11000000 */
  public static final int RANGE_6_TO_7 = B7 | B6;
}